import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/details/:userid/:cpid',
    name: 'details',
    props:true,
    component: () => import('../views/Details.vue'),
    meta:{
      Header:true
    }
  },
  {
    path: '/menuquery/:kw?',
    name: 'menuquery',
    props:true,
    component: () => import('../views/MenuQuery.vue'),
    meta:{
      Header:true
    }
  },
  {
    path: '/releaseitem',
    name: 'releaseitem',
    component: () => import('../views/ReleaseItme.vue'),
    meta:{
      Header:true
    }
  },
  {
    path: '/release',
    name: 'release',
    component: () => import('../views/Release.vue'),
  },
  {
    path: '/updata',
    name: 'updata',
    component: () => import('../views/Updata.vue'),
    meta:{
      Header:true
    }
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/Register.vue'),
    meta:{
      Header:true
    }
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login.vue'),
    meta:{
      Header:true
    }
  },
  {
    path: '/',
    name: 'home',
    component: () => import('../views/Home.vue'),
    meta:{
      Header:true
    }
  },
  {
    path: '/search',
    name: 'search',
    component: () => import('../views/Search.vue'),
    meta:{
      Header:true
    }
  },
  {
    path: '/personal',
    name: 'personal',
    component: () => import('../views/Personal.vue'),
  },
  {
    path: '/classification',
    name: 'classification',
    component: () => import('../views/ClassiFicaTion.vue'),
    children:[
      {
        path:'cuisine/:cname',
        name: 'cuisine',
        component: () => import('../views/Cuisine.vue'),
      }
    ]
  },
  {
    path: '/homepage',
    name: 'homepage',
    component: () => import('../views/HomePage.vue'),
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
